#include <iostream>
#include <vector>
using std::cout;
using std::endl;
class Point {
public:
    Point (int x,int y)
        :_x(x)
         ,_y(y)    
    {
        cout<<"Point(int x ,int y)"<<endl;
    }

    Point(const Point & rhs)
        :_x(rhs._x)
         ,_y(rhs._y)
    {
        cout<<"Point(const Point &rhs)"<<endl;
    }

    void print(){
        cout<<"("<<_x<<","<<_y<<")"<<endl;
    }

private:
    int _x;
    int _y;
};

void test(){
    std:: vector<Point> pt;
    pt.reserve(20);
    pt.emplace_back(1,1);
    pt.emplace_back(2,2);
    pt.emplace_back(3,3);
    pt.emplace_back(4,4);
    pt.emplace_back(5,5);
    cout<<"---------------"<<endl;
    for(auto &p:pt){
    p.print();
    }
    cout<<"--------------"<<endl;
    for(size_t i =0;i<pt.size();i++){
            pt[i].print();
    }
    cout<<"--------------"<<endl;
    auto it = pt.begin();
    while(it !=pt.end()){
        it->print();
        it++;
    }
    cout<<"------------"<<endl;
}

int main()
{
    test ();
    return 0;
}

